<template>
  <div class="daughter">
    女儿:(家庭总资产为：{{ count }})
    <button @click="makeMoney">赚钱</button>
    <button @click="spendMoney">花钱</button>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { defineProps } from "vue";
import eventBus from "../utils/eventBus";

const props = defineProps({
  count: {
    type: Number,
    required: true,
  },
});

const makeMoney = () => {
  eventBus.emit("makeMoney");
};

const spendMoney = () => {
  eventBus.emit("spendMoney");
};
</script>

<style>
.daughter {
  margin-top: 20px;
  margin-left: 20px;
  background-color: #2168ae;
  color: #ffffff;
  width: 800px;
  height: 200px;
}
</style>